{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 2.3 – Solving Reactive Balances In-depth\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2.3.0 – Learning Objectives\n", "\n", "By the end of this section you should be able to:\n", "\n", "1. Solve simple reactive balances using the molecular and atomic reactive balances.\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2.3.1 – Introduction\n", "\n", "We will solve the example in the diagram 4.71 using the molecular species and atomic species balance. Python will be implemented to perform calculations. This section goes in-depth of the logic used to solve the problem that is addressed before.\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2.3.2 – Problem statement\n", "\n", "\n", "Recall the block diagram in figure 4.7-1\n", "\n", "$$\n", " C_2H_6 \\longrightarrow C_2H_4 + H_2\n", "$$\n", "\n", "![](../figures/Module-2/ethane-reaction.png)\n", "\n", "What are the __mol flows__ of the exit streams of ethane $C_6H_6$ and ethylene $C_4H_4$?\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "## 2.3.3 – Solving using the molecular species balance\n", "\n", "First, we __identify our molecular species__; for us, this is Hydrogen, Ethane and Ethylene.\n", "\n", "Next, we __write out their respective balance equations__. Note how the diagram 4.7-1 only shows the __output__ variables ($\\dot{n_1},\\dot{n_2}$)\n", "\n", "$$C_2H_6 balance: 100 \\frac{kmol}{min}_{input} =\\dot{n_1}\\frac{kmol}{min}_{Output} + C_2H_{6Consumed} $$\n", "\n", "$$C_2H_4 balance: C_2H_{4generated} = \\dot{n_2}\\frac{kmol}{min}_{Output}$$\n", " \n", "$$H_2 balance: 40 \\frac{kmol}{min}_{generated} = 40 \\frac{kmol}{min}_{Output}$$\n", "\n", "\n", "To further relate these equations, __use the stoichiometrey__ of the dehydrogenation reaction which gives a relationship between the __consumed and generated__ terms:\n", "\n", "\n", "$$ C_2H_6 \\rightarrow C_2H_4 + H_2 $$ \n", "\n", "\n", "Since there is a 1:1 ratio between the Generation of Hydrogen to $C_2H_4$:\n", "\n", "$$ 40 \\frac{kmol}{min}H_{2generated} * \\frac{1 \\frac{kmol}{min}C_2H_4}{1 \\frac{kmol}{min}H_2} = 40\\frac{kmol}{min}C_2H_{4generated} $$\n", "\n", "\n", "\n", "Since there is a 1:1 ratio between the generation of hydrogen and the consumption of Ethane, $C_2H_{6consumed} = 40\\frac{kmol}{min}$.\n", "\n", "\n", "\n", "Substituting the $C_2H_{6Consumed}$ and the $C_2H_{4generated}$ into their respective equations, we can see that the outputs of ethane and ethylene $(\\dot{n_1},\\dot{n_2})$ are $60\\frac{kmol}{min}$ and $40\\frac{kmol}{min}$ respectively.\n", "\n", "\n", "$$ C_2H_6 balance: 100 \\frac{kmol}{min}_{input} =\\dot{n_1}\\frac{kmol}{min}_{Output} + 40\\frac{kmol}{min} C_2H_{6Output} $$\n", "\n", "$$ \\dot{n_1}= 60 \\frac{kmol}{min}_{Output}$$\n", "\n", "$$ C_2H_4 balance: C_2H_{4generated} = \\dot{n_2}\\frac{kmol}{min}_{Output} = 40\\frac{kmol}{min}C_2H_{4generated} $$\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## 2.3.4 – Solving using the Atomic species balance\n", "\n", "Let's recall the Atomic balances:\n", "\n", "$$ Carbon (C) \\space balance: Input = Output$$\n", "\n", "$$ Hydrogen (H) \\space balance: Input = Output$$\n", "\n", "First the Atomic balances are broken down to __collect any molecular species__ containing the atomic species __(Carbon and Hydrogen)__. \n", "\n", "The carbon balance becomes: \n", "$$ C_2H_{6input} = C_2H_{6output} + C_2H_{4output} $$\n", "\n", "The hydrogen balance becomes:\n", "\n", "$$ C_2H_{6input} = C_2H_{6output} + C_2H_{4output} + H_{2output}$$ \n", "\n", "We then __isolate the atomic species__ from the molecular species. Another way of thinking is: How many of N atoms are there in this molecule? For example, there are 2 carbon atoms for every 1 ethane molecule.\n", "\n", "The carbon balance becomes: \n", "\n", "$$ C_2H_{6input}*\\frac{2C\\frac{kmol}{min}}{1C_2H_6\\frac{kmol}{min}} = C_2H_{6output}*\\frac{2C\\frac{kmol}{min}}{1C_2H_6\\frac{kmol}{min}} + C_2H_{4output}*\\frac{2C\\frac{kmol}{min}}{1C_2H_6\\frac{kmol}{min}} $$\n", "\n", "The hydrogen balance becomes:\n", "\n", "$$ C_2H_{6input}*\\frac{6H\\frac{kmol}{min}}{1C_2H_6\\frac{kmol}{min}} = C_2H_{6output}*\\frac{6H\\frac{kmol}{min}}{1C_2H_6\\frac{kmol}{min}} + C_2H_{4output}*\\frac{4H\\frac{kmol}{min}}{1C_2H_6\\frac{kmol}{min}}+H_{2output}*\\frac{2H\\frac{kmol}{min}}{1H_2\\frac{kmol}{min}} $$ \n", "\n", "\n", "Note from diagram 4.7-1, the input and output values are substituted for their respective integers and variables. Remember that ethane and ethene outputs are defined as ($\\dot{n_1},\\dot{n_2}$)\n", "\n", "rewriting the balances \n", "\n", "The carbon balance becomes: \n", "$$ 200 \\frac{kmol}{min} = \\dot{2n_1} + \\dot{2n2} $$\n", "\n", "The hydrogen balance becomes:\n", "\n", "$$ 600 \\frac{kmol}{min} = 6\\dot{n_1} + 4\\dot{n_2} + 80 \\frac{kmol}{min}$$ \n", "\n", "This is a simple linear equation to solve. This notebook will use the sympy linear algebra solver." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The value of ethane is 60kmol/min \n", "The value of ethylene is 40kmol/min \n" ] } ], "source": [ "#import the sympy libary\n", "import sympy as sym\n", "# Write symbolic variables n1 and n2\n", "sym.var(['n1','n2'])\n", "# Setup equations \n", "eqns = [\n", " sym.Eq(2*n1 + 2*n2 , 200),\n", " sym.Eq(6*n1+4*n2+80,600)\n", "]\n", "#solve equations\n", "sol = sym.solve(eqns)\n", "print(\"The value of ethane is {}kmol/min \\nThe value of ethylene is {}kmol/min \".format(sol[n1],sol[n2]))\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }